"use strict";

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = (app) => {
  const { router, controller, middleware } = app;
  const _jwt = middleware.jwtErr(app.config.jwt.secret); // 传入加密字符串

  router.post("/register", controller.user.register); //注册

  router.post("/login", controller.user.login); //登录

  router.post("/getUserInfo", _jwt, controller.user.getUserInfo); //获取用户信息

  router.post("/editUserInfo", _jwt, controller.user.editUserInfo); //修改用户信息

  router.post("/upload", _jwt, controller.upload.upload); //修改用户信息

  // router.post('/test', _jwt, controller.user.test);

  // router.get('/getList', controller.goods.getList);
};
